<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Kostka do gry zrobiona  przez Bartka i JB</title>
		<script>
			var losuj =function() {
			
				var a=document.getElementById("x");

				window.setTimeout(function(){
					a.innerHTML="3";
				}, 1000);
				
				
				window.setTimeout(function(){
					a.innerHTML="2";
				}, 2000);
				
				window.setTimeout(function(){
					a.innerHTML="1";
				}, 3000);
				window.setTimeout(function(){
					a.innerHTML="<img src='kostka"+
						(parseInt(Math.random()*100)%6+1)
					+".png' />";
				}, 4000);
			}
		</script>
	</head>
	<body>
	<div id="x">LAMA </div>
	<button onclick="losuj()">Rzuć kostką</button>
	</body>
</html>

